<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>EquTemper: An overview of source code</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="$relpath<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>/search.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">EquTemper&#160;<span id="projectnumber">1.01</span></div>
   <div id="projectbrief">An equation editor.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<script type="text/javascript">
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}

function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('sp_src_idx.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">An overview of source code </div>  </div>
</div>
<div class="contents">
<div class="textblock"><p>This page attempts to give an overview of the source code and to give the new coder a place to start. The documentation is created using <a href="http://www.doxygen.org">Doxygen</a> and, as such, has a couple standard features ( <a href="annotated.html">class list</a>, <a href="files.html">file list</a>, <a href="todo.html">todo page</a>). Also, class inheritance page, both in <a href="hierarchy.html">text form</a> and in <a href="inherits.html">graphical form</a>, provide and insight into the way source code is organised. However, this page will attempt to describe the classes based on their logical relations and intended purpose.</p>
<h2><a class="anchor" id="class_gen"></a>
Generic classes</h2>
<p>Only two related clases fell into this category right now: <a class="el" href="class_c_c___l2_d.html" title="class representing the list element in a linked list system">CC_L2D</a> and <a class="el" href="class_c_c___h_d_l2_d.html" title="class representing the list header in a linked list system">CC_HDL2D</a>. These provide a simple implementation for a linked list, where <a class="el" href="class_c_c___h_d_l2_d.html" title="class representing the list header in a linked list system">CC_HDL2D</a> is the header that may be embedded inside other classes and <a class="el" href="class_c_c___l2_d.html" title="class representing the list element in a linked list system">CC_L2D</a> is the class that needs to be inherited by the classes that are to be linked. <a class="el" href="class_c_c___h_d_l2_d.html" title="class representing the list header in a linked list system">CC_HDL2D</a> only stores a count of items it hosts and the pointer to the first kid, while <a class="el" href="class_c_c___l2_d.html" title="class representing the list element in a linked list system">CC_L2D</a> stores pointers to previous nad next items; no link is made to <a class="el" href="class_c_c___h_d_l2_d.html" title="class representing the list header in a linked list system">CC_HDL2D</a> that hosts it, so classes need to implement links to parents themselves.</p>
<h2><a class="anchor" id="class_gui"></a>
Graphical User Interface (GUI) classes</h2>
<p>The cental widget is represented by the <a class="el" href="class_main_window.html" title="form that represents main GUI component">MainWindow</a> class. It's functionality is divided into modules addressing specific issues:</p>
<ul>
<li>Generic units<ul>
<li><a class="el" href="class_m_w___basic_mdi.html" title="logic unit responsible for providing common functionality for using Multiple Document Interface in Ma...">MW_BasicMdi</a> is the logic unit responsible for providing common functionality for using Multiple Document Interface (MDI); it handles the list of visible docuiments available in the Windows menu and is able to get a pointer to the active <a class="el" href="class_mdi_child.html" title="form representing a document inside MDI area">MdiChild</a> document.</li>
<li><a class="el" href="class_m_w___basic_slots.html" title="groups event handlers that are most likely to be used by any simple GUI application">MW_BasicSlots</a> groups event handlers that are most likely to be used by any simple GUI application, ranging from simple file opperations (new, open, close) to editing opperations (cut, copy, paste, delete) to help handlers.</li>
<li><a class="el" href="class_m_w___recent_files.html" title="List of recent files provided by a logical unit.">MW_RecentFiles</a> it is able to load a previously saved list of files and to show it in designated menu. Also able to direct the application into loading a recent file.</li>
<li><a class="el" href="class_m_w___ui_templ.html" title="encapsulates the look and feel of a GUI">MW_UiTempl</a> encapsulates the look and feel of a GUI. Allows the user to change the apparence of all widgets based on predefined templates.</li>
<li><a class="el" href="class_m_w___style_sheets.html" title="allows the customisation of the apparence of widgets">MW_StyleSheets</a> allows to further customise of the apparence of widgets; this functionality is based on HTML-like <a href="http://doc.qt.nokia.com/latest/stylesheet.html">style sheets </a>.</li>
</ul>
</li>
<li>Specific units<ul>
<li><a class="el" href="class_m_w___sheet_slots.html" title="manages signals that are intended to reach the active sheet in current MDI document.">MW_SheetSlots</a> manages signals that are intended to reach the active sheet or active viewport in active sheet in current MDI document.</li>
</ul>
</li>
</ul>
<p>The panels inside MDI area are all <a class="el" href="class_mdi_child.html" title="form representing a document inside MDI area">MdiChild</a> instances. At file level (and, possiblly, at class level at some point in the future) the functionality is divided in two more logical parts beside the main:</p>
<ul>
<li><a class="el" href="mdic__basic_8h.html" title="Contains the definition for basic interaction in mdi window.">mdic_basic.h</a> file has functionality that gives a target to <a class="el" href="class_m_w___basic_slots.html" title="groups event handlers that are most likely to be used by any simple GUI application">MW_BasicSlots</a> and is mostly related to file and edit opperations.</li>
<li>mdic_viewport.h supports the use of mustiple span-able viewports and zoom and rotation for current viewport.</li>
</ul>
<h2><a class="anchor" id="sheets"></a>
Sheets. Viewports.</h2>
<p>The architecture is similar to that used in Qt, where the in-memory storage is isolated in a separate class, with other classes being able to represent contained data.</p>
<p><a class="el" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> class is a logical root for all elements contained in a document. It inherits from <a href="http://doc.qt.nokia.com/latest/qgraphicsscene.html">QGraphicsScene</a> most of it's functionality. Exactly one <a class="el" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> instance is associated with a <a class="el" href="class_mdi_child.html" title="form representing a document inside MDI area">MdiChild</a> instance.</p>
<p><a class="el" href="class_e_t_sheet_view.html" title="Widget capable of displaying an ETSheet content.">ETSheetView</a> class (the viewport) is able to represent the content of an <a class="el" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a>. It drives it's functionality from <a href="http://doc.qt.nokia.com/latest/qgraphicsview.html">QGraphicsView</a>. Each <a class="el" href="class_mdi_child.html" title="form representing a document inside MDI area">MdiChild</a> instance may contain one or more <a class="el" href="class_e_t_sheet_view.html" title="Widget capable of displaying an ETSheet content.">ETSheetView</a> viewports, but they will all look at the same scene.</p>
<h2><a class="anchor" id="items_subitems"></a>
Items and sub-items</h2>
<p>The items are instances of classes that inherit from <a href="http://doc.qt.nokia.com/latest/qgraphicsitem.html">QGraphicsItem</a> and the names always start with <b>ETI_</b>. These are hosted and managed by <a class="el" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> class and are selectable and movable by the user. Currently, there are two types of items:</p>
<ul>
<li><a class="el" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a>, which is a host for <a class="el" href="class_e_t_sub_item.html" title="class representing the common interface exposed by all sub-items of a ETI_CplxTxt">ETSubItem</a> sub-items and represents a complex text (that may be an equation or formula);</li>
<li><a class="el" href="class_e_t_i___m_txt.html" title="class">ETI_MTxt</a>, extending the functionality of <a href="http://doc.qt.nokia.com/latest/qgraphicstextitem.html">QGraphicsTextItem</a> and, as such, being able to display a formatted chunk of text.</li>
</ul>
<p>The sub-items are instances of classes that inherit from <a class="el" href="class_e_t_sub_item.html" title="class representing the common interface exposed by all sub-items of a ETI_CplxTxt">ETSubItem</a> and have names that always start with <b>ETSI_</b> . These are hosted in an <a class="el" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a> instance and may form a complex tree, as each sub-item may contain another sub-items on it's turn. The types of sub-items that are currently defined ae listed below:</p>
<ul>
<li><a class="el" href="class_e_t_s_i___root.html" title="sub-item able to host a row of horizontal sub-items">ETSI_Root</a>: sub-item able to host a row of horizontal sub-items; this is one of the building blocks used to create more complex sub-items</li>
<li><a class="el" href="class_e_t_s_i___s_text.html" title="simple sub-item capable to display a string">ETSI_SText</a>: simple sub-item capable of displayng a string; another building block for more complex sub-items</li>
<li><a class="el" href="class_e_t_s_i___fract.html" title="sub-item displaying a fraction; consists of two ETSI_Root sub-items">ETSI_Fract</a>: sub-item displaying a fraction; consists of two <a class="el" href="class_e_t_s_i___root.html" title="sub-item able to host a row of horizontal sub-items">ETSI_Root</a> sub-items</li>
<li><a class="el" href="class_e_t_s_i___h_text.html" title="presents a central text and has six other ETSI_Root arround it">ETSI_HText</a>: presents a central text and has six other <a class="el" href="class_e_t_s_i___root.html" title="sub-item able to host a row of horizontal sub-items">ETSI_Root</a> arround it</li>
<li><a class="el" href="class_e_t_s_i___integ.html" title="sub-item presenting an integral; consists of four ETSI_Root sub-items">ETSI_Integ</a>: sub-item representing an integral</li>
<li><a class="el" href="class_e_t_s_i___lim.html" title="sub-item presenting a limit">ETSI_Lim</a>: sub-item presenting a limit</li>
<li><a class="el" href="class_e_t_s_i___logic_ac.html" title="sub-item able to display a logical if-elseif-else component">ETSI_LogicAc</a>: sub-item able to display a logical if-elseif-else component</li>
<li><a class="el" href="class_e_t_s_i___matrix.html" title="sub-item presenting a matrix or a determinant">ETSI_Matrix</a>: sub-item presenting a matrix or a determinant</li>
<li><a class="el" href="class_e_t_s_i___radic.html" title="sub-item that will display a radical">ETSI_Radic</a>: sub-item that will display a radical</li>
<li><a class="el" href="class_e_t_s_i___sum.html" title="sub-item that will display a sum; consists of three ETSI_Root sub-items">ETSI_Sum</a>: sub-item that will display a sum</li>
</ul>
<h2><a class="anchor" id="vp_commands"></a>
Viewport commands</h2>
<p>Each view is able to maintain a command independent of other views. Having multiple views looking at a single scene means that there may be multiple commands running against same scene.</p>
<p>Commands are instances of classes that inherit from <a class="el" href="class_e_t_vp_command.html" title="abstract class representing prerequisites for a command running in a ETSheetView">ETVpCommand</a> and, basically, require the caller to create an instance of the command, initialise the options, and pass the instance to <a class="el" href="class_e_t_sheet_view.html#aede56f48bf9600e59e3a58e1af33fc0c" title="starts a command; will cancel previous command if running">ETSheetView::startCommand()</a>.</p>
<p>Following commands are defined so far:</p>
<ul>
<li><a class="el" href="class_e_t_vp_cmd___edit_sub_i.html" title="viewport command that edits an sub-item">ETVpCmd_EditSubI</a>: starts the editing of an sub-item</li>
<li><a class="el" href="class_e_t_vp_cmd___new_sub_i.html" title="command used to create new sub-items; may create all known types">ETVpCmd_NewSubI</a>: creates a new sub-item</li>
<li><a class="el" href="class_e_t_vp_cmd___new_top_elem.html" title="command that creates a new item in a sheet">ETVpCmd_NewTopElem</a>: creates a new item</li>
</ul>
<h2><a class="anchor" id="undo_redo"></a>
Undo and redo</h2>
<p>This functionality is implemented at sheet level, meaning that all sheets have the ability to keep a chain of changes independent of other sheets that may be opened at the same time.</p>
<p>The class that implements the interface used by other components is <a class="el" href="class_e_t_undo_head.html" title="class representing the base of an undo-redo system in a sheet">ETUndoHead</a> and an instance is embedded in each <a class="el" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a>. Undo and redo opperations are all chained in a single row, with a pointer walking the chain according to the commands it recieves.</p>
<p>Each unitary opperation is an instance of a class that inherits from <a class="el" href="class_e_t_undo_elem.html" title="class representing the common interface exposed by all sub-items of a ETI_CplxTxt">ETUndoElem</a>. This abstract class provides the means to access the instances and send them undo / redo commands independent of the underlying opperation.</p>
<h2><a class="anchor" id="save_load"></a>
Saving and loading from xml file</h2>
<p>There is no separate class that does this opperations. Instead, the functionality is embedded inside <a class="el" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> via <a class="el" href="class_e_t_sheet.html#a4f37965444156d4502512b3391c3c83f" title="save the content of current sheet to a xml file">ETSheet::saveXMLFile()</a> and <a class="el" href="class_e_t_sheet.html#a17384eea523b013c593abf6be0e73623" title="add the content of a xml file to current sheet">ETSheet::loadXMLFile()</a>. As the name implies the XML format is used in saving / loading the file and <a href="http://doc.qt.nokia.com/latest/qtxml.html">QtXml Module</a> is used to accomplish the tasks.</p>
<p>The format of the file that is saved follows the guidance in <a href="https://code.google.com/p/equtemper/source/browse/trunk/doc/example.xml">example.xml</a> that is located in <a href="https://code.google.com/p/equtemper/source/browse/trunk/doc">doc</a> subfolder.</p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000005">Todo:</a></b></dt><dd>current implementation does not check for a version. Do that.</dd></dl>
<hr/>
 Step to next page: <a class="el" href="future_plans.html">things that need to be done.</a> or go to previous page: <a href="index.html">documentation home</a> </p>
</div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="main.html">EquTemper source code documentation</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

    <li class="footer">Generated on Sun Oct 23 2011 22:06:49 for EquTemper by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li>
   </ul>
 </div>
</body>
</html>
